package com.raycloud.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.raycloud.dao.MsgIndexDao;
import com.raycloud.dao.common.BaseDao;
import com.raycloud.domain.MsgIndex;

public class MsgIndexDaoImpl extends BaseDao implements MsgIndexDao{

	public void insertMsgIndex(MsgIndex msgIndex) {
		getSqlMapClientTemplate().insert("msgIndex.insertMsgIndex", msgIndex);
	}

	@SuppressWarnings("unchecked")
	public List<MsgIndex> queryMsgIndexs(long userId, int firstResult,
			int maxResults, String dbId) {
		Map<String, Object> codition = new HashMap<String, Object>();
		codition.put("userId", userId);
		codition.put("firstResult", firstResult);
		codition.put("maxResults", maxResults);
		codition.put("dbId", dbId);
		return getSqlMapClientTemplate().queryForList("msgIndex.queryMsgIndexsByUser", codition);
	}
}
